Same change as the previous one for Cetus. These crashes haven't been reported,...
authorparkrrrr <parkrrrr@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Wed, 15 Oct 2003 16:31:32 +0000 (16:31 +0000)
committerparkrrrr <parkrrrr@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Wed, 15 Oct 2003 16:31:32 +0000 (16:31 +0000)
gpsbabel/magnav.c
gpsbabel/magproto.c
gpsbabel/mapopolis.c

index 269c1313d5cd43e6fdff3d527ba453cf7f0deef7..f7c13815e20e1e6d8473048ec5c27dcbc90842ac 100644 (file)
@@ -155,11 +155,12 @@ my_writewpt(const waypoint *wpt)
                wpt->shortname;
 
        rec = xcalloc(sizeof(*rec)+56,1);
-       
+
+        tm = NULL;     
        if ( wpt->creation_time ) {
                tm = gmtime( &wpt->creation_time);
        }
-       else {
+       if ( !tm ) {
                time( &tm_t );
                tm = gmtime( &tm_t );
        }
index 4f19669e9a8b8f61f56217606d34011de80b7d22..3ed780db5f6b5ed92f1c5cebf2c3f7af5096c10c 100644 (file)
@@ -1203,12 +1203,18 @@ void mag_track_disp(const waypoint *waypointp)
 
        ilat = waypointp->position.latitude.degrees;
        ilon = waypointp->position.longitude.degrees;
+       tm = NULL;
        if (waypointp->creation_time) {
                tm = gmtime(&waypointp->creation_time);
-               hms = tm->tm_hour * 10000 + tm->tm_min  * 100 + tm->tm_sec;
-               date = tm->tm_mday * 10000 + tm->tm_mon * 100 + tm->tm_year;
-               fracsec = waypointp->centiseconds;
-       } else  {
+               if ( tm ) {
+                       hms = tm->tm_hour * 10000 + tm->tm_min  * 100 + 
+                                  tm->tm_sec;
+                       date = tm->tm_mday * 10000 + tm->tm_mon * 100 + 
+                                  tm->tm_year;
+                       fracsec = waypointp->centiseconds;
+               }
+       }
+        if (!tm) {
                date = 0;
                fracsec = 0;
        }
index a6bf20e0f8bbb7b9e8f7daf77851cec50afd4fe3..2cf8f9a995a8e36c752e83267084bc80b87381ba 100644 (file)
@@ -200,11 +200,12 @@ my_writewpt(const waypoint *wpt)
                wpt->shortname;
 
        rec = xcalloc(sizeof(*rec)+56,1);
-       
+
+        tm = NULL;     
        if ( wpt->creation_time ) {
                tm = gmtime( &wpt->creation_time);
        }
-       else {
+       if ( !tm ) {
                time( &tm_t );
                tm = gmtime( &tm_t );
        }